package cn.tedu.csmall.product.controller;

import cn.tedu.csmall.product.pojo.entity.Admin;
import cn.tedu.csmall.product.pojo.vo.AdminStandardVO;
import cn.tedu.csmall.product.service.IAdminService;
import cn.tedu.csmall.product.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * 登录处理的控制层
 * @author java@tedu.cn
 * @version 0.0.1
 */
@RestController
@Api(tags = "4.用户管理模块")
@RequestMapping("/admins")
@Slf4j
public class AdminController {

    @Autowired
    IAdminService service;

    // http://localhost:8090/admins/login
    @ApiOperation("管理员登录")
    @PostMapping("/login")
    public JsonResult login(@RequestBody Admin admin) {
        Integer result = service.login(admin);
        return JsonResult.ok(result);
    }
}
